/*
 * Copyright user2010
 * All rights reserved
 */

package org.myorg.applitest.gui.swing.components.panel;

import javax.swing.GroupLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 *
 * @author user
 */
public class lbzVrtTextField extends JPanel{
    public lbzVrtTextField(String strText, int length){

        initializeComponents(strText, length);

    }
    private void initializeComponents(String strText, int length)
    {
        lblChamp = new JLabel();
        txfChamp = new JTextField();

        lblChamp.setText(strText + " :");
        int d = lblChamp.getSize().width;
        javax.swing.GroupLayout layout = new GroupLayout(this);
        this.setLayout(layout);
        

        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addComponent(txfChamp, GroupLayout.PREFERRED_SIZE, length, GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblChamp))
             )
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(lblChamp)
                //.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txfChamp,GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            )
        );

    }

    public String getText(){
        return txfChamp.getText();
    }
    JLabel lblChamp;
    JTextField txfChamp;

}
